package c.c.a;

import android.content.ContentValues;
import android.database.Cursor;
import c.b.a.a.a;
import com.huawei.hms.analytics.core.crypto.AesCipher.AesLen;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import org.json.JSONException;
import org.json.JSONObject;

public abstract class s implements Cloneable {
    public static final SimpleDateFormat h = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
    public long a = System.currentTimeMillis();
    public long b;
    public String c;
    public String d;
    public String e;
    public String f;
    public String g;

    public abstract s a(Cursor cursor);

    public abstract void b(ContentValues contentValues);

    public abstract void c(JSONObject jSONObject);

    public abstract String[] d();

    public final ContentValues e(ContentValues contentValues) {
        if (contentValues == null) {
            contentValues = new ContentValues();
        } else {
            contentValues.clear();
        }
        b(contentValues);
        return contentValues;
    }

    public abstract s f(JSONObject jSONObject);

    public abstract JSONObject g();

    public final String h() {
        String[] d = d();
        if (d == null) {
            return null;
        }
        StringBuilder stringBuilder = new StringBuilder(AesLen.ROOTKEY_COMPONET_LEN);
        stringBuilder.append("create table if not exists ");
        stringBuilder.append(i());
        stringBuilder.append("(");
        for (int i = 0; i < d.length; i += 2) {
            stringBuilder.append(d[i]);
            stringBuilder.append(" ");
            stringBuilder.append(d[i + 1]);
            stringBuilder.append(",");
        }
        stringBuilder.delete(stringBuilder.length() - 1, stringBuilder.length());
        stringBuilder.append(")");
        return stringBuilder.toString();
    }

    public abstract String i();

    public final JSONObject j() {
        try {
            this.g = h.format(new Date(this.a));
            return g();
        } catch (JSONException e) {
            m0.b(e);
            return null;
        }
    }

    /* renamed from: k */
    public s clone() {
        try {
            return (s) super.clone();
        } catch (CloneNotSupportedException e) {
            m0.b(e);
            return null;
        }
    }

    public String l() {
        StringBuilder g = a.g("sid:");
        g.append(this.c);
        return g.toString();
    }

    public String toString() {
        if (!m0.b) {
            return super.toString();
        }
        StringBuilder i;
        String i2 = i();
        String str = ", ";
        if (!getClass().getSimpleName().equalsIgnoreCase(i2)) {
            i = a.i(i2, str);
            i.append(getClass().getSimpleName());
            i2 = i.toString();
        }
        String str2 = this.c;
        String str3 = "-";
        if (str2 != null) {
            int indexOf = str2.indexOf(str3);
            if (indexOf >= 0) {
                str2 = str2.substring(0, indexOf);
            }
            str3 = str2;
        }
        i = a.j("{", i2, str);
        i.append(l());
        i.append(str);
        i.append(str3);
        i.append(str);
        i.append(this.a);
        i.append("}");
        return i.toString();
    }
}
